import {
	apiResquest
} from '../api/index.js'

//POST 请求案例

// 登录请求  小程序 / h5公众号
// export const wxlogin = (query) => {
// 	return apiResquest({
// 		// url: `Passport/login`,
// 		url:`login/login`,
// 		method: 'POST',
// 		query: {
// 			...query
// 		}
// 	})
// }

// 抖音
export const ttlogin = (query) => {
	return apiResquest({
		// url: `Passport/login`,
		url:`Ttlogin/login`,
		method: 'POST',
		query: {
			...query
		}
	})
}

//ios用户 屏蔽支付 
export const appletConfig = (query) => {
	return apiResquest({
		url:`topUp/appletConfig`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 添加微信授权获取的用户信息
export const setWechatUserInfo = (query) => {
	return apiResquest({
		// url: `Passport/login`,
		url:`login/setWechatUserInfo`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 修改用户信息
export const userEdit = (query) => {
	return apiResquest({
		url:`user/edit`,
		method: 'POST',
		query: {
			...query
		}
	})
}

export const login = (query) => {
	return apiResquest({
		url: `Wx/getWxUserInfo`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 订阅
export const Subscribe = (query) => {
	return apiResquest({
		url: `wx/addSubscribe`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 投诉建议
export const postProposal = (query) => {
	return apiResquest({
		url: `user/proposal`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 小剧场分类请求
export const getSmallTheaterClass = (query) => {
	return apiResquest({
		url: `home/index`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取指定分类的视频数据
export const getListByType = (query) => {
	return apiResquest({
		url: `home/getListByType`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取分类详情
export const getSmallTheaterDetails = (query) => {
	return apiResquest({
		url: `home/getVideoDetail`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取历史记录
export const getrecordlist = (query) => {
	return apiResquest({
		url: `record/getHistoryList`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取追剧记录
export const getBingeWatchList = (query) => {
	return apiResquest({
		url: `record/getBingeWatchList`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取排行数据
export const getypeList = (query) => {
	return apiResquest({
		url: `home/typeList`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取关注用户列表
export const getConcern = (query) => {
	return apiResquest({
		url: `user/getConcern`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取我的喜欢列表
export const getLike = (query) => {
	return apiResquest({
		url: `video/getLove`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 推荐视频
export const getRecommendVideo = (query) => {
	return apiResquest({
		url: `Video/info`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 新增追剧
export const getaddPlay = (query) => {
	return apiResquest({
		url: `record/addPlay`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 取消追剧
export const getcancelPlay = (query) => {
	return apiResquest({
		url: `record/cancelPlay`,
		method: 'POST',
		query: {
			...query
		}
	})
}


// 获取会员套餐
export const getMemberPackage = (query) => {
	return apiResquest({
		url: `topUp/memberPackage`,
		method: 'GET',
		query: {
			...query
		}
	})
}

// 新增历史记录
export const getaddHistory = (query) => {
	return apiResquest({
		url: `record/add`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取发布视频人员信息
export const getUserDetail = (query) => {
	return apiResquest({
		url: `user/getUserDetail`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 查看发布者的全部视频
export const allVideo = (query) => {
	return apiResquest({
		url: `user/allVideo`,
		method: 'GET',
		query: {
			...query
		}
	})
}

// 新增我的关注
export const getuserFans = (query) => {
	return apiResquest({
		url: `user/fansEdit`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 新增我的喜欢
export const getMyLike = (query) => {
	return apiResquest({
		url: `video/getLike`,
		method: 'POST',
		query: {
			...query
		}
	})
}

export const getMyLifeLike = (query) => {
	return apiResquest({
		url: `life/giveLike`,
		method: 'POST',
		query: {
			...query
		}
	})
}


// 用户书币下单
// export const getBookorder = (query) => {
// 	return apiResquest({
// 		url: `wx/payBookCurrency`,
// 		method: 'POST',
// 		query: {
// 			...query
// 		}
// 	})
// }

export const getBookorder = (query) => {
	return apiResquest({
		url: `TtPay/ttpay`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 书币成功下单调用的接口
export const getSuccessBook = (query) => {
	return apiResquest({
		url: `pay/updatePayStatus`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 更新书币
export const getBookGold = (query) => {
	return apiResquest({
		url: `user/getBookCurrency`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 付费请求
export const getPayVideo = (query) => {
	return apiResquest({
		url: `video/watchVideoPay`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取充值记录请求
export const getPayRecord = (query) => {
	return apiResquest({
		url: `record/getPayRecord`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取消费记录请求
export const getWatchPayRecord = (query) => {
	return apiResquest({
		url: `record/getWatchPayRecord`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取
export const getisOnline = (query) => {
	return apiResquest({
		url: `video/isOnline`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取充值金额列表
export const getMoneyList = (query) => {
	return apiResquest({
		url: `topUp/topUpPackage`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 点击签到
export const getSignDay = (query) => {
	return apiResquest({
		url: `user/sign`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取签到数据
export const getSignList = (query) => {
	return apiResquest({
		url: `user/userSignData`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取搜索列表
export const getSearchVideo = (query) => {
	return apiResquest({
		url: `video/search`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取热门搜索列表
export const getSearchHot = (query) => {
	return apiResquest({
		url: `video/getSearchList`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 获取推荐剧情
export const getRecommendList = (query) => {
	return apiResquest({
		url: `video/getRecommendList`,
		method: 'GET',
		query: {
			...query
		}
	})
}

//GET 签到
export const sign = (query) => {
	let str = query
	return apiResquest({
		url: `user/sign`,
		method: 'GET',
		query: {
			...query
		}
	})
}

// 根据公众号id获取公众号appid
export const getOfficialAppID = (query) => {
	return apiResquest({
		url: `Official/getOfficialInfo`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 根据小程序appid获取首页签到及推文消息
export const getWxAppID = (query) => {
	return apiResquest({
		url: `home/getAppletInfo`,
		method: 'POST',
		query: {
			...query
		}
	})
}

// 订阅消息
export const signTip = (query) => {
	return apiResquest({
		url: `home/signTip`,
		method: 'POST',
		query: {
			...query
		}
	})
}

//GET 请求案例可以传递参数也可以不传递
export const validateCode = (query) => {
	let str = query
	return apiResquest({
		url: `您的API地址 ?${str}`,
		method: 'GET'
	})
}

